package tesoreria.test;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SubMenu;


public class mobiletesoreria extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    
    private static final int MENU_LOCATION = Menu.FIRST + 1;
    private static final int MENU_LOCATION_BAN = Menu.FIRST + 2;
    private static final int MENU_LOCATION_LIB = Menu.FIRST + 3;
    private static final int MENU_LOCATION_PAG = Menu.FIRST + 4;
    private static final int MENU_LOCATION_CON = Menu.FIRST + 5;
    
    private static final int MENU_LOCATION2 = Menu.CATEGORY_SECONDARY + 1;
    private static final int MENU_LOCATION_CUE = Menu.CATEGORY_SECONDARY + 2;
    private static final int MENU_LOCATION_IND = Menu.CATEGORY_SECONDARY + 3;
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
		SubMenu sub = menu.addSubMenu (0, MENU_LOCATION, 0 , "Indicadores")
		.setIcon(R.drawable.indicadores1);
		sub.add(0,MENU_LOCATION_BAN,0, "Movimientos en Bancos");
		sub.add(0,MENU_LOCATION_LIB,0, "Movimientos en Libros");
		sub.add(0,MENU_LOCATION_PAG,0, "Pagos");
		sub.add(0,MENU_LOCATION_CON,0, "Conciliación Bancaria");
		
		SubMenu sub2 = menu.addSubMenu (0, MENU_LOCATION2, 0 , "Generales")
		.setIcon(R.drawable.generales1);
		sub2.add(0,MENU_LOCATION_CUE,0, "Ver cuentas Bancarias");
		sub2.add(0,MENU_LOCATION_IND,0, "Configurar Indicadores");
			
    return true;
    }
    
    public boolean onOptionsItemSelected (MenuItem item) {
	    switch (item.getItemId()) {
	      case MENU_LOCATION_BAN:
	    	  showIndmovban();
	       break;
	    
	      case MENU_LOCATION_LIB:
	    	  showIndmovlib();
	      break;

	      case MENU_LOCATION_PAG:
	    	  showIndejepag();
	      break;	      
	    
	      case MENU_LOCATION_CON:
	    	  showIndconban();
	      break;	      
	      
	      case MENU_LOCATION_CUE:
	    	  showVercueban();
	      break;	      
	      
	      case MENU_LOCATION_IND:
	    	  showConvalind();
	      break;	      
	    }
	    return super.onOptionsItemSelected(item);
    }

    
    public void showIndmovban(){
    	Intent Indmovban = new Intent(this, indmovban.class);
    	startActivity(Indmovban);
    	}
    
    public void showIndmovlib(){
    	Intent Indmovlib = new Intent(this, indmovlib.class);
    	startActivity(Indmovlib);
    	}    

    public void showIndejepag(){
    	Intent Indejepag = new Intent(this, indejepag.class);
    	startActivity(Indejepag);
    	}

    public void showIndconban(){
    	Intent Indconban = new Intent(this, indconban.class);
    	startActivity(Indconban);
    	}    

    public void showVercueban(){
    	Intent Vercueban = new Intent(this, vercueban.class);
    	startActivity(Vercueban);
    	}    

    public void showConvalind(){
    	Intent Convalind = new Intent(this, convalind.class);
    	startActivity(Convalind);
    	}    
    
}